<template>
  <div class="form-box">
    <AplidForm :disabled="true" ref="formEl" v-bind="formConfig" v-model="formModel">
      <template v-slot:grantAmountForm>
        <p v-if="formModel.grantStatus == '0'" class="text-orange">审核中......待发放</p>
        <p v-else>{{ formModel.grantAmount }}</p>
      </template>
      <template v-slot:amountForm>
        <div class="flex align-center w-100">
          <p class="money-label">
            <span>总金额</span>
            <span class="text-tag">¥60000</span>
          </p>
          <p  class="money-label">
            <span>大写</span>
            <span  class="text-tag">{{dealBigMoney(60000)}}</span>
          </p>
        </div>
      </template>
    </AplidForm>
  </div>
</template>

<script setup lang="ts">
import {dealBigMoney} from '@/utils/util'

const props =defineProps<{
  nowRowData: any
}>()
const emit = defineEmits(['refresh'])
const formModel:any = ref({
  grantStatus:0
})

const formConfig = {
  inline: false,
	showBtn: false,
  submitBtnText:'确定',
  backBtnText:'取消',
	labelPosition: 'top',
	labelWidth: '100px',
	column: [
     {
			label: '回执操作人',
			prop: 'receipt_operator',
			span: 24,
      placeholder: '',
		},
		{
			label: '回执图片',
      listType:'picture-card',
			prop: 'receipt_imgs',
			type: 'upload',
			labelPosition: 'top',
			showFileList: true,
			multiple: false,
			span: 24,
      placeholder: '',
		},
	],
}

watchEffect(() => {
	 if(props.nowRowData && typeof props.nowRowData === 'string') {
      formModel.value = JSON.parse(props.nowRowData)
   }
})

</script>

<style scoped lang="scss">
:deep(.el-form--default.el-form--label-top .el-form-item .el-form-item__label) {
  font-family: "Microsoft YaHei Bold";
  font-weight: 700;
  font-size: 20px;
  text-align: left;
  color: #1c1c28;
}
.form-box {
  width:45%;
  margin:0 auto;
  .money-label {
    min-width: vw(200);
  }
  .text-tag {
    margin-left:20px;
    padding:4px 16px;
    height: 29px;
    border-radius: 6px;
    background: #f57350;
    font-family: "Microsoft YaHei";
    font-weight: 400;
    font-size: 16px;
    text-align: left;
    color: #fff;
  }
}
</style>